"""myBlog URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from index import views, testdb, searchForm, operatedb
from django.views.decorators.cache import cache_page
from django.conf.urls.static import static
from django.conf import settings
from . import settings
urlpatterns = [
    path('admin/', admin.site.urls),
    path('index/', include('index.urls')),
    path('template/', views.template),
    path('testdb/', testdb.testdb),
    path('searchForm/', searchForm.search_Form),
    path('searchGet/', searchForm.searchGet),
    path('searchPost/', searchForm.searchPost),
    path('operatedb/', operatedb.operatedb),
    path('cookie_set_get/', views.cookie_set_get),
    path('login/', views.login, name='login'),
    path('logout/', views.logout, name='logout'),
    path('session_set_get/', views.session_set_get),
    path('logins/', views.logins),
    path('backend/', views.backend),
    path('logouts/', views.logouts),
    path('cacheFile/', views.cacheFile),
    path('cacheFile1/', cache_page(10)(views.cacheFile1)),
    path('book/', views.book),
    path('redis_cache/', views.redis_cache),
    path('getPage/', views.getPage),
    path('byPaginator/', views.byPaginator),
    path('uploader/', views.upload),
    path('fileList/', views.fileList),
    path('delete/', views.delete),
    path('download/', views.download),
    path('toSendMail/',views.toSendMail),
    path('sendMail/',views.sendMail),
    path('sendManyMail/',views.sendManyMail),
    # ckeditor富文本编辑器
    path('ckeditor/', include('ckeditor_uploader.urls')),

    
    path('ajaxTest/', include('ajaxTest.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # 在开发环境里debug模式下，这句是必不可少的，没有的话，你上传的图片将无法显示。
